package com.woniu.liuzhougov.common.utils;

/**
 * @version 1.0
 * @Author zhuxinpan
 * @ClassName Result
 * @Description 结果工具类
 * @Date 2019/4/19 15:39
 */
public class Result {
    private Integer code;
    private String message;
    private Object data;

    public Result(String s, String 删除成功) {
    }

    public Result(Integer code) {
        this.code = code;
    }

    public Result(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Result(Integer code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public static Result success() {
        return new Result(0);
    }

    public static Result success(Integer code, String message) {
        return new Result(code, message);
    }

    public static Result success(String message) {
        return new Result(0, message);
    }

    public static Result error() {
        return new Result(500);
    }

    public static Result error(Integer code, String message) {
        return new Result(code, message);
    }

    public static Result error(String message) {
        return new Result(500, message);
    }


    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
